/*
 * @Author: kanglang
 * @Date: 2020-09-18 11:03:02
 * @LastEditors: 汪滔
 * @LastEditTime: 2021-04-19 11:52:46
 * @Description: 订单相关api
 */
import { fetchGet, fetchPost } from '../config';
// 订单相关
export default {
  // 油卡订单列表
  orderPage(params) {
    return fetchGet('order-api/api/v1/order/getMyOilCardOrderList', params);
  },
  // 查看订单信息
  orderInfo(params) {
    return fetchGet('order-api/api/v1/order/totalMyOilCardOrder', params);
  },
  // 取消油卡订单
  cancelOrder(params) {
    return fetchGet('order-api/api/v1/order/closeOilCardOrder', params);
  },
  // 确认订单
  confirmOrder(params) {
    return fetchPost('order-api/api/v1/order/confirmOrder', params);
  },
  // 提交订单
  submitOrder(params) {
    return fetchPost('order-api/api/v1/order/submitOrder', params);
  },
  // 油卡订单详情
  orderDetail(params) {
    return fetchGet('order-api/api/v1/order/getMyOilCardOrderDetails', params);
  },
  // 实体订单列表
  getMyMallOrderList(params) {
    return fetchGet('order-api/api/v1/order/getMyMallOrderList', params);
  },
  // 取消订单
  closeOrderApp(params) {
    return fetchGet('order-api/api/v1/order/closeOrderApp', params);
  },
  // 确认订单
  confirmOrderApp(params) {
    return fetchGet('order-api/api/v1/order/confirmOrderApp', params);
  },
  // 退款详情
  getMyRefundOrderDetail(params) {
    return fetchGet('order-api/api/v1/order/getMyRefundOrderDetail', params);
  },
  getMyMallOrderDetails(params) {
    return fetchGet('order-api/api/v1/order/getMyMallOrderDetails', params);
  },
  // 联通订单列表
  getMyUnionOrderList(params) {
    return fetchGet('order-api/api/v1/order/getMyLiantongOrderList', params);
  },
  // 电话充值提交
  confirmOrderTel(params) {
    return fetchPost('order-api/api/v1/order/confirmOrder', params);
  },
  // 联通订单详情
  getMyUnionOrderDetails(params) {
    return fetchGet('order-api/api/v1/order/getMyLiantongOrderDetails', params);
  },
  // 检查联通限额
  checkLiantongAmount(params) {
    return fetchGet('order-api/api/v1/order/checkLiantongAmount', params);
  },
  // 支付页面详情b2b
  payDetailB2b(params) {
    return fetchPost(
      'merchant-order-api/api/v1/merchant/order/app/payDetail',
      params,
    );
  },
  // 确认订单b2b
  confirmOrderDetailB2b(params) {
    return fetchGet(
      'merchant-order-api/api/v1/merchant/order/app/confirmOrderDetail',
      params,
    );
  },
  // 获取支付订单详情b2b
  getPayDetailB2b(orderNo) {
    return fetchGet(
      `merchant-order-api/api/v1/merchant/order/app/getPayDetail/${orderNo}`,
    );
  },
  // 获取订单详情b2b
  getOrderDetailB2b(orderNo) {
    return fetchGet(
      `merchant-order-api/api/v1/merchant/order/app/orderDetail/${orderNo}`,
    );
  },
  // 获取支付验证码b2b
  getSmsCodeB2b(orderNo) {
    return fetchGet(
      `merchant-order-api/api/v1/merchant/order/app/getSmsCode/${orderNo}`,
    );
  },
  // 确认收货验证码b2b
  getRecSmsCode(orderNo) {
    return fetchGet(
      `merchant-order-api/api/v1/merchant/order/app/getRecSmsCode/${orderNo}`,
    );
  },
  // 确认收货b2b
  confirmReceiptB2b({ orderNo, recCode }) {
    return fetchGet(
      `merchant-order-api/api/v1/merchant/order/app/confirmReceipt?orderNo=${orderNo}&recCode=${recCode}`,
    );
  },
  // 支付订单b2b
  submitPayOrderB2b(params) {
    return fetchPost(
      'merchant-order-api/api/v1/merchant/order/pay/payOrder',
      params,
    );
  },
  // 取消订单b2b
  cancelOrderB2b(params) {
    return fetchPost(
      'merchant-order-api/api/v1/merchant/order/app/cancelOrder',
      params,
    );
  },
  // 退款原因
  refundReasons(key) {
    return fetchGet(`order-api/api/v1/order/refund/refundReasons/${key}`);
  },
  // 申请退款
  applyRefund(params) {
    return fetchPost('order-api/api/v1/order/refund/applyRefund', params);
  },
  // 申请退款(修改)
  updateRefund(params) {
    return fetchPost('order-api/api/v1/order/refund/updateRefund', params);
  },
  // 退款详情
  refundDetail(businessNo) {
    return fetchGet(`order-api/api/v1/order/refund/refundDetail/${businessNo}`);
  },
  // 撤销申请
  cancelRefund(businessNo) {
    return fetchPost(
      `order-api/api/v1/order/refund/cancelRefund/${businessNo}`,
    );
  },
  // 设置退货自提点
  setAddress(businessNo, selfAddressId) {
    return fetchPost(
      `order-api/api/v1/order/refund/setAddress/${businessNo}/${selfAddressId}`,
    );
  },
  // 判断是否是联通号
  checkIfLiantongMobile(params) {
    return fetchGet('order-api/api/v1/order/checkIfLiantongMobile', params);
  },
  // 确认线下支付
  submitOfflinePay(params) {
    return fetchGet(
      'merchant-order-api/api/v1/merchant/order/app/submitOfflinePay',
      params,
    );
  },
  // 上传支付凭证
  paymentVoucher(params) {
    return fetchPost(
      'merchant-order-api/api/v1/merchant/order/app/upload/paymentVoucher',
      params,
    );
  },
  // 删除支付凭证
  delPaymentVoucher(orderNo) {
    return fetchPost(
      `merchant-order-api/api/v1/merchant/order/app/del/paymentVoucher/${orderNo}`,
    );
  },
  //   确认支付结果b2b（第三方）
  featchSyncVerifiPayB2b(params) {
    return fetchGet('merchant-order-api/api/v1/merchant/order/pay/confimOrder', params);
  },
};
